package com.probiz.estore.customer.service;

import java.util.List;

import com.probiz.estore.common.model.customer.Feedback;
import com.probiz.estore.core.search.SearchCriteria;
import com.probiz.estore.core.service.GenericManager;
import com.probiz.estore.customer.model.FeedbackSearchCriteria;


/**
 * Feedback Business Delegate (Proxy) Interface to handle communication between web and
 * persistence layer.
 * Developer introduced interfaces should be declared here. Won't get overwritten.
 *
 */
public interface FeedbackManager extends GenericManager<Feedback> {
	
	
	/**
	 * 完全删除函数
	 * @param productReview
	 */
	public void deleteFully(Feedback feedback);
	/**
	 * 搜索反馈
	 * @param feedbackSearchCriteria
	 * @param searchCriteria
	 * @return
	 */
	public List<Feedback> searchByCriteria(FeedbackSearchCriteria feedbackSearchCriteria, SearchCriteria searchCriteria);
	
	/**
     * 搜索，从GenericController借鉴过来。防止翻页过钱
     *
     * @param feedbackSearchCriteria 自定义搜索条件
     * @param searchCriteria        分页搜索条件
     * @return 搜索结果
     */
    public List<Feedback> searchByCriteriaForController(FeedbackSearchCriteria feedbackSearchCriteria, SearchCriteria searchCriteria);
    /**
     * 标识为已阅
     * @param feedback
     */
    public void doMarkRead(Feedback feedback);
    
    /**
     * 标识为未阅
     * @param feedback
     */
    public void doMarkUnRead(Feedback feedback);
    
    /**
     * 标识为可见
     * @param feedback
     */
    public void doMarkShow(Feedback feedback);
    
    /**
     * 标识为不可见
     * @param feedback
     */
    public void doMarkUnShow(Feedback feedback);
    
    /**
	 * 保存回复
	 * @param reply
	 */
	public void saveReply(Feedback reply);
	
	/**
	 * 更新反馈的回复数量
	 * 
	 * @param feedback  反馈
	 * @param replyCount  要改变的数量，可正可负
	 * @param onShowReplyCount  要改变的激活数量，可正可负
	 */
	public void updateFeedbackReplyCount(Feedback feedback,Integer replyCount, Integer onShowReplyCount);
	
	/**
	 * 定时器，定时统计反馈下的回复数量
	 * -------暂没用，不处理旧数据
	 */
	public void doCalReplyCountForScheduling();
	
	/**
	 * 获得反馈的所有可见回复
	 * @param feedbackId
	 * @return
	 */
	public List<Feedback> getOnShowReplyListByFeedbackId(Integer feedbackId);

	/**
	 * 获得“我发表的反馈” 的个数
	 * @param customerId
	 * @return 
	 */
	public Integer[] getCountsOfCustomer(Integer customerId);
	
	/**
	 * 获得平台总反馈数量
	 * @return
	 */
	public Long countFeedbackTotal();
	/**
	 * 获取平台未回复的反馈数
	 * @return
	 */
	public Long countUnreplyFeedbackTotal();
	
	
}
